package controller;

import gui.ConsolePanel;
import gui.TextEditorPanel;
import jahuwaldt.plot.Plot;

public class PlotController {
	private PlotController() {

	}

	public static PlotController getInstance() {

		if (plotController == null) {
			plotController = new PlotController();
		}

		return plotController;

	}
	
	public void plotData(){
		if(this.curPlotData != null)
			this.textEditorPanel.addInternalPlotFrame(this.curPlotData);
		else
			System.out.println("No Plot Data!");
	}

	public void setTextEditorPanel(TextEditorPanel textEditorPanel) {
		this.textEditorPanel = textEditorPanel;
	}

	public TextEditorPanel getTextEditorPanel() {
		return textEditorPanel;
	}

	public void setConsolePanel(ConsolePanel consolePanel) {
		this.consolePanel = consolePanel;
	}

	public ConsolePanel getConsolePanel() {
		return consolePanel;
	}

	public void setCurPlotData(Plot curPlotData) {
		this.curPlotData = curPlotData;
	}

	public Plot getCurPlotData() {
		return curPlotData;
	}

	private static PlotController plotController = null;
	private TextEditorPanel textEditorPanel = null;
	private ConsolePanel consolePanel = null;
	private Plot curPlotData = null;
}
